#include "mainwindow.h"
#include "ui_mainwindow.h"
#include <QDebug>

MainWindow::MainWindow(QWidget *parent) :
    QMainWindow(parent),
    ui(new Ui::MainWindow)
{
    ui->setupUi(this);

    intButtonIcon();

    connect(ui->prevBtn,&QPushButton::clicked,this,&MainWindow::handlPrevSlot);
    connect(ui->playBtn,&QPushButton::clicked,this,&MainWindow::handlPlaySlot);
    connect(ui->nextBtn,&QPushButton::clicked,this,&MainWindow::handlNextSlot);

}
void MainWindow::intButtonIcon()
{
    ui->prevBtn->setIcon(QIcon(":/img/prev.png"));
    ui->prevBtn->setIconSize(QSize(ui->prevBtn->width(), ui->prevBtn->height()));
    ui->prevBtn->setStyleSheet("QPushButton {background-color : rgba(255, 255, 255, 0);}");

    ui->playBtn->setIcon(QIcon(":/img/play.png"));
    ui->playBtn->setIconSize(QSize(ui->playBtn->width(), ui->playBtn->height()));
    ui->playBtn->setStyleSheet("QPushButton {background-color : rgba(255, 255, 255, 0);}");

    ui->nextBtn->setIcon(QIcon(":/img/next.png"));
    ui->nextBtn->setIconSize(QSize(ui->nextBtn->width(), ui->nextBtn->height()));
    ui->nextBtn->setStyleSheet("QPushButton {background-color : rgba(255, 255, 255, 0);}");

    ui->modeBtn->setIcon(QIcon(":/img/mode.png"));
    ui->modeBtn->setIconSize(QSize(ui->modeBtn->width(), ui->modeBtn->height()));
    ui->modeBtn->setStyleSheet("QPushButton {background-color : rgba(255, 255, 255, 0);}");

    ui->loveBtn->setIcon(QIcon(":/img/love.png"));
    ui->loveBtn->setIconSize(QSize(ui->loveBtn->width(), ui->loveBtn->height()));
    ui->loveBtn->setStyleSheet("QPushButton {background-color : rgba(255, 255, 255, 0);}");
}
void MainWindow::handlPrevSlot()
{
    qDebug() << "上一首"<<endl;
}
void MainWindow::handlPlaySlot()
{
     qDebug() << "暂停/播放"<<endl;
}
void MainWindow::handlNextSlot()
{
     qDebug() << "下一首"<<endl;
}
MainWindow::~MainWindow()
{
    delete ui;
}
